package com.baizhi.controller;

import com.baizhi.dto.PageDTO;
import com.baizhi.service.CategoryService;
import com.baizhi.vo.CommonQueryPageVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@CrossOrigin
@RestController
public class CategoryController {

    private static final Logger log = LoggerFactory.getLogger(CategoryController.class);
    @Resource
        CategoryService categoryService;

    @PostMapping("/category/queryOnePage")
    public CommonQueryPageVO queryOnePage(@RequestBody PageDTO pageDTO){
        log.info("接收的数据:{}",pageDTO);
        return categoryService.queryOnePage(pageDTO);
    }
}
